package cn.smbms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.smbms.dao.ProviderMapper;
import cn.smbms.pojo.Provider;
@Service("providerService")
public class ProviderServiceImpl implements ProviderService {
	
	@Autowired
	private ProviderMapper providerMapper;
	
	public List<Provider> getProviderList(String proCode,String proName,int pageSize,int currentPageNo) {
		
		return providerMapper.getProviderList(proCode, proName, pageSize, currentPageNo);
	}

	public int addProvider(Provider provider) {
		return providerMapper.addProvider(provider);
	}

	public int countProvider(String proCode, String proName) {
		
		return providerMapper.countProvider(proCode, proName);
	}

	
	public List<Provider> getProList() {
		return providerMapper.getProList();	
	}

	
	public int updateProvider(Provider provider) {
		return providerMapper.updateProvider(provider);
	}

	
	public boolean deleteProvider(Integer id) {
		boolean flag=false;
		if(providerMapper.deleteProvider(id)>0) {
			flag=true;
		}
		return flag;
	}

	
	public Provider getProviderById(int id) {
		return providerMapper.getProviderById(id);
	}

	

}
